package com.example.springboot.bean;
/**
 * 要加载
 *    <dependency>
 *        <groupId>org.springframework.boot</groupId>
 *        <artifactId>spring-boot-configuration-processor</artifactId>
 *        <optional>true</optional>
 *    </dependency>
 *
 *    这个工具  只要是 application.yml 的配置提示
 *    否则 此类也会提示你加载这个类
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Component//表示这是个组件
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@ConfigurationProperties(prefix = "person")//核心配置文件绑定
public class Person {

    private String userName;
    private Boolean boss;
    private Date birth;
    private Integer age;
    private Pet pet;
    private String[] interests;
    private List<String> animal;
    private Map<String, Object> score;
    private Set<Double> salary;
    private Map<String, List<Pet>> allPets;

    public Person(String[] interests, List<String> animal, Map<String, Object> score, Set<Double> salary) {
        this.interests = interests;
        this.animal = animal;
        this.score = score;
        this.salary = salary;
    }
}